﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WeiTap.Data.TransactionManager
{
    public class Transaction : ITransaction
    {
        private Database _db;
        public Transaction(Database db) {
            _db = db;
        }
        public void Complete()
        {
            _db.CompleteTransaction();
            _db = null;
        }

        public void Dispose()
        {
            if (_db != null)
                _db.AbortTransaction();
        }
    }
}
